﻿using System.Text;
using CoreEx.Common.Extensions;
using CoreEx.Database.Metadata.Generation;
using LinFu.IoC.Configuration;

namespace CoreEx.Database.MetaData.Implementation.Generation
{
    [Implements(typeof(IPropertyCommentGenerator))]
    public class PropertyCommentGenerator : IPropertyCommentGenerator
    {
        public string GetComment(string typeName, string propertyTypeName, bool isEnumerable)
        {
            var comment = new StringBuilder();
            comment.AppendLine(1, "/// <summary>");

            if (isEnumerable)
                comment.AppendLine(1, "Gets a list of {0}", propertyTypeName);
            else            
                comment.AppendLine(1, "Gets or sets the {0}", propertyTypeName);

            comment.AppendLine(1, "/// </summary>");

            return comment.ToString();

            
        }
    }

    
}
